{% extends 'base.html' %}
{% load static %}
{% load i18n %}

{% block content %}
<link rel="stylesheet" type="text/css" href="{% static 'admin/css/forms.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'admin/css/widgets.css' %}">
<link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}">


<form method="get">
    {{ filter.form.media }}
    {{ filter.form.as_p }}

    <p>Note: Year format is YYYY-mm-dd</p>
    <button class="btn btn-primary btn-lg" type="submit" name="search_interview">Search</button>
    <button class="btn btn-primary btn-lg" type="submit" name="download_interview">Download Results</button>
  </form>


<h1>Search Results: {{ filter.qs.count }}</h1>
<div class="panel panel-default">
    <table class="table">
    	<tr>
                <th>Name</th>
                <th>Date</th>
                <th>Position</th>
                <th>Status</th>
                <th>Result</th>
            </tr>
    {% for interview in interviews %}
    <tr>
        <td><a href={% url 'Evaluator:interview_details' interview.pk %}>{{ interview }}</a></td>
        <td>{{ interview.date }} </td>
        <td>{{ interview.position.name }} </td>
        <td>{{ interview.get_status_display }} </td>
        <td>{{ interview.get_result_display }} </td>
    </tr>
    {% endfor %}
	</table>

</div>

{% if interviews.has_other_pages %}
  <ul class="pagination">
    {% if interviews.has_previous %}
      <li><a href="?page={{ interviews.previous_page_number }}">&laquo;</a></li>
    {% else %}
      <li class="disabled"><span>&laquo;</span></li>
    {% endif %}
    {% for i in interviews.paginator.page_range %}
      {% if interviews.number == i %}
        <li class="active"><span>{{ i }} <span class="sr-only">(current)</span></span></li>
      {% else %}
        <li><a href="?page={{ i }}">{{ i }}</a></li>
      {% endif %}
    {% endfor %}
    {% if interviews.has_next %}
      <li><a href="?page={{ interviews.next_page_number }}">&raquo;</a></li>
    {% else %}
      <li class="disabled"><span>&raquo;</span></li>
    {% endif %}
  </ul>
{% endif %}

<script type="text/javascript" src="/admin/jsi18n/"></script>
<script type="text/javascript" src="{% static 'admin/js/core.js' %}"></script>
<script type="text/javascript" src="{% static 'admin/js/admin/RelatedObjectLookups.js' %}"></script>
<script type="text/javascript" src="{% static 'admin/js/vendor/jquery/jquery.min.js' %}"></script>
<script type="text/javascript" src="{% static 'admin/js/jquery.init.js' %}"></script>
<script type="text/javascript" src="{% static 'admin/js/actions.min.js' %}"></script>
<script type="text/javascript" src="{% static 'admin/js/calendar.js' %}"></script>
<script type="text/javascript" src="{% static 'admin/js/admin/DateTimeShortcuts.js' %}"></script>

{% endblock %}
